﻿<UserControl x:Class="Project.RegisterComplaintPart2"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="1350" d:DesignWidth="900" xmlns:my="clr-namespace:CustomControls;assembly=CustomControls">
    <UserControl.Resources>
        <DataTemplate x:Key="EvidenceItemsTemplate">
            <Border Width="720" Height="30" BorderBrush="#69810E" BorderThickness="0,0,0,1">
                <StackPanel Orientation="Horizontal">
                    <TextBlock VerticalAlignment="Center" FontSize="14" Text="{Binding Number}" Margin="5,0,8,0"/>
                    <TextBlock Width="670" TextWrapping="Wrap" VerticalAlignment="Center" FontWeight="Light" FontSize="12"  Text="{Binding Description}" />
                    <Button ToolTip="Eliminar evidencia" VerticalAlignment="Center" HorizontalAlignment="Center" Name="btnDelete" Click="btnDelete_Click">
                        <Button.Style>
                            <Style TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
                                <Setter Property="Visibility" Value="Hidden" />
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type ListBoxItem}},Path=IsMouseOver}" Value="True">
                                        <Setter Property="Visibility" Value="Visible" />
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </Button.Style>
                        <Image VerticalAlignment="Center" HorizontalAlignment="Center" Source="Images/delete.gif" Width="25" Height="25"></Image>
                    </Button>
                </StackPanel>
            </Border>
        </DataTemplate>
        <DataTemplate x:Key="FunctionaryItemsTemplate">
            <Border Width="730" Height="30" BorderBrush="#69810E" BorderThickness="0,0,0,1">
                <StackPanel Orientation="Horizontal">
                    <TextBlock Width="305" VerticalAlignment="Center" FontWeight="Light" FontSize="14" Text="{Binding Path=Name,StringFormat='Nombre: {0}'}" Margin="5,0,8,0"/>
                    <TextBlock Width="125" VerticalAlignment="Center" FontWeight="Light" FontSize="14"  Text="{Binding Path=CI,StringFormat='CI: {0}'}" Margin="0,0,8,0" />
                    <TextBlock Width="245" VerticalAlignment="Center" FontWeight="Light" FontSize="14"  Text="{Binding Path=Rank,StringFormat='Rango: {0}'}" />
                    <Button ToolTip="Eliminar funcionario" VerticalAlignment="Center" HorizontalAlignment="Right" Name="btnDeleteFunctionary" Click="ButtonBase_OnClick">
                        <Button.Style>
                            <Style TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
                                <Setter Property="Visibility" Value="Hidden" />
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type ListBoxItem}},Path=IsMouseOver}" Value="True">
                                        <Setter Property="Visibility" Value="Visible" />
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </Button.Style>
                        <Image VerticalAlignment="Center" HorizontalAlignment="Center" Source="Images/delete.gif" Width="25" Height="25"></Image>
                    </Button>
                </StackPanel>
            </Border>
        </DataTemplate>
    </UserControl.Resources>
    <Grid Height="1350" Width="900">
        <my:MaskTextBox Watermark="Máximo 700 caracteres, mínimo 50!" DataType="RegEx" MaxLength="700" Height="200" HorizontalAlignment="Left" Margin="30,98,0,0" TextWrapping="Wrap" VerticalScrollBarVisibility="Auto" AcceptsReturn="True" IsUndoEnabled="True" Name="tbIncidentDetail" RegEx="^[A-Za-z0-9´.,#°?¿()áéíóúAÉÍÓÚÑñ\s]+$" VerticalAlignment="Top" Width="825" />
        <Label Content="*Detalle del Hecho:" FontSize="16" FontWeight="Normal" Height="25" HorizontalAlignment="Left" Margin="30,76,0,0" Name="label4" VerticalAlignment="Top" />
        <GroupBox Header="*Evidencias" Height="288" HorizontalAlignment="Left" Margin="30,351,0,0" Name="groupBox1" VerticalAlignment="Top" Width="825">
            <Grid>
                <Label Content="Evidencias recojidas en el lugar de los hechos o recibidas:" Height="24" HorizontalAlignment="Left" Margin="30,22,0,0" Name="label1" VerticalAlignment="Top" />
                <ListBox ItemTemplate="{StaticResource EvidenceItemsTemplate}" ItemsSource="{Binding}" Height="114" HorizontalAlignment="Left" Margin="30,106,0,0" Name="listBoxEvidences" VerticalAlignment="Top" Width="750" />
                <Button Height="35" HorizontalAlignment="Left" Margin="30,47,0,0" Name="btnAddEvidence" VerticalAlignment="Top" Width="152" Click="btnAddEvidence_Click">
                        <StackPanel Orientation="Horizontal">
                        <TextBlock Text="AGREGAR EVIDENCIA" Height="20" />
                        <Image Width="20" Height="20" Margin="5,0,0,0" Source="Images/add.gif" />
                    </StackPanel>
                </Button>
                <Grid Height="196" HorizontalAlignment="Left" Margin="188,35,0,0" Name="gridAddEvidence" Background="White" VerticalAlignment="Top" Width="371">
                    <Border BorderThickness="1" BorderBrush="#5C5C5C">
                        <Grid>
                            <Button Content="AGREGAR" Height="23" HorizontalAlignment="Left" Margin="216,162,0,0" Name="btnAddSuccess" VerticalAlignment="Top" Width="75" Click="btnAddSuccess_Click" />
                            <Button Content="CANCELAR" Height="23" HorizontalAlignment="Left" Margin="100,162,0,0" Name="btnAddCancel" VerticalAlignment="Top" Width="75" Click="btnAddCancel_Click" />
                            <Label Content="Evidencia:" FontSize="16" FontWeight="Normal" Height="28" HorizontalAlignment="Left" Margin="15,10,0,0" Name="label2" VerticalAlignment="Top" />
                            <Label Content="" FontSize="16" FontWeight="Light" Height="28" HorizontalAlignment="Left" Margin="87,11,0,0" Name="lblEvidenceNumber" VerticalAlignment="Top" />
                            <Label Content="Descripción:" Height="28" HorizontalAlignment="Left" Margin="15,44,0,0" Name="label3" VerticalAlignment="Top" />
                            <my:MaskTextBox MaxLength="50" AcceptsReturn="True" DataType="RegEx" Height="88" HorizontalAlignment="Left" IsUndoEnabled="True" Margin="15,62,0,0" Name="tbEvidenceDescription" RegEx="^[A-Za-z0-9'.,#°?¿()áéíóúAÉÍÓÚÑñ\s]+$" TextWrapping="Wrap" VerticalAlignment="Top" VerticalScrollBarVisibility="Auto" Watermark="Máximo 50 caracteres, mínimo 15" Width="336" />
                            <Label Visibility="Hidden" Foreground="Red" Content="La Descripción debe tener al menos 15 caracteres" Height="18" HorizontalAlignment="Left" Margin="87,44,0,0" Name="lblEvidenceERROR" VerticalAlignment="Top" />
                        </Grid>
                    </Border>
                </Grid>
                <Label Content="Evidencias:" Height="28" HorizontalAlignment="Left" Margin="30,88,0,0" Name="label5" VerticalAlignment="Top" />
                <Label Content="Debe agregar por lo menos una evidencia" Height="19" Foreground="Red" HorizontalAlignment="Left" Margin="30,6,0,0" Visibility="Hidden" Name="lblEvidencesError" VerticalAlignment="Top" />
            </Grid>
        </GroupBox>
        <GroupBox Header="*Funcionarias que intervinieron en el caso" Height="544" HorizontalAlignment="Left" Margin="30,683,0,0" Name="groupBox2" VerticalAlignment="Top" Width="825">
            <Grid>
                <Label Content="Intervinientes:" Height="28" FontSize="16" FontWeight="Normal" HorizontalAlignment="Left" Margin="30,23,0,0" Name="label6" VerticalAlignment="Top" />
                <ListBox  Height="140" ItemTemplate="{StaticResource FunctionaryItemsTemplate}" ItemsSource="{Binding}" HorizontalAlignment="Left" Margin="30,94,0,0" Name="listBoxIntervinents" VerticalAlignment="Top" Width="750" />
                <Button Height="35" HorizontalAlignment="Left" Margin="30,51,0,0" Name="btnAddIntervinent" VerticalAlignment="Top" Width="177" Click="btnAddIntervinent_Click">
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Height="20" Text="AGREGAR FUNCIONARIO(A)" />
                        <Image Height="20" Margin="5,0,0,0" Source="Images/add.gif" Width="20" />
                    </StackPanel>
                </Button>
                <StackPanel Margin="0,238,0,6">
                    <Grid Height="28" Margin="30,30,0,0">
                        <Label Content="*Recepcionista:" FontSize="16" FontWeight="Normal" Height="28" HorizontalAlignment="Left" Margin="0,0,0,0" Name="label7" VerticalAlignment="Top" />
                        <Button Click="btnSelectRecepter_Click" Name="btnSelectRecepter" Height="25" Margin="115,0,559,0">
                            <Button.Content>
                                <StackPanel Orientation="Horizontal">
                                    <TextBlock VerticalAlignment="Center" HorizontalAlignment="Left" Margin="2,0,0,0" Text="SELECCIONAR"/>
                                    <Image Source="Images/Search.gif" Width="25" VerticalAlignment="Center" HorizontalAlignment="Right" />
                                </StackPanel>
                            </Button.Content>
                        </Button>
                        <Label Content="Tiene que seleccionar a la recepcionista" Visibility="Hidden" Foreground="Red" Height="24" Name="lblRecepterError" Margin="231,2,333,2" />
                    </Grid>
                <StackPanel Visibility="Collapsed" Name="RecepterInfo" Height="35" Orientation="Horizontal" Margin="0,0,0,0">
                    <Label Content="Nombre:" Height="28" HorizontalAlignment="Left" Margin="30,5,0,0" Name="label10" VerticalAlignment="Top" />
                    <Label Content="" Height="28" HorizontalAlignment="Left" Margin="5,5,0,0" Name="lblRecepterName" VerticalAlignment="Top" FontWeight="Bold" />
                    <Label Content="Ci:" Height="28" HorizontalAlignment="Left" Margin="15,5,0,0" Name="label11" VerticalAlignment="Top" />
                    <Label Content="" Height="28" HorizontalAlignment="Left" Margin="5,5,0,0" Name="lblRecepterCi" VerticalAlignment="Top" FontWeight="Bold" />
                    </StackPanel>
                    <Grid Height="28" Margin="30,14,0,0">
                        <Label Content="*Asignada:" FontSize="16" FontWeight="Normal" Height="28" HorizontalAlignment="Left" Margin="0,0,0,0" Name="label8" VerticalAlignment="Top" />
                        <Button Click="btnSelectAsigned_Click" Name="btnSelectAsigned" Height="25" Margin="80,0,601,0">
                            <Button.Content>
                                <StackPanel Orientation="Horizontal">
                                    <TextBlock VerticalAlignment="Center" HorizontalAlignment="Left" Margin="2,0,0,0" Text="SELECCIONAR"/>
                                    <Image Source="Images/Search.gif" Width="25" VerticalAlignment="Center" HorizontalAlignment="Right" />
                                </StackPanel>
                            </Button.Content>
                        </Button>
                        <Label Content="Tiene que seleccionar a la asignada al caso" Foreground="Red" Visibility="Hidden" Height="18" HorizontalAlignment="Left" Margin="196,4,0,0" Name="lblAsignedError" VerticalAlignment="Top" />
                    </Grid>
                <StackPanel Visibility="Collapsed" Name="AsignedInfo" Height="35" Orientation="Horizontal" Margin="0,0,0,0">
                    <Label Content="Nombre:" Height="28" HorizontalAlignment="Left" Margin="30,5,0,0" Name="label12" VerticalAlignment="Top" />
                    <Label Content="" Height="28" HorizontalAlignment="Left" Margin="5,5,0,0" Name="lblAsignedName" VerticalAlignment="Top" FontWeight="Bold" />
                    <Label Content="Ci:" Height="28" HorizontalAlignment="Left" Margin="15,5,0,0" Name="label13" VerticalAlignment="Top" />
                    <Label Content="" Height="28" HorizontalAlignment="Left" Margin="5,5,0,0" Name="lblAsignedCi" VerticalAlignment="Top" FontWeight="Bold" />
                    </StackPanel>
                    <Grid Height="28" Margin="30,14,0,0">
                        <Label Content="*Jefe de Seguridad:" FontSize="16" FontWeight="Normal" Height="28" HorizontalAlignment="Left" Margin="0,0,0,0" Name="label9" VerticalAlignment="Top" />
                        <Button Click="btnSelectSecBoss_Click" Name="btnSelectSecBoss" Height="25" Margin="139,0,537,0">
                            <Button.Content>
                                <StackPanel Orientation="Horizontal">
                                    <TextBlock VerticalAlignment="Center" HorizontalAlignment="Left" Margin="2,0,0,0" Text="SELECCIONAR"/>
                                    <Image Source="Images/Search.gif" Width="25" VerticalAlignment="Center" HorizontalAlignment="Right" />
                                </StackPanel>
                            </Button.Content>
                        </Button>
                        <Label Content="Tiene que seleccionar al jefe de seguridad" Visibility="Hidden" Height="20" Foreground="Red" HorizontalAlignment="Left" Margin="259,4,0,0" Name="lblSecBossError" VerticalAlignment="Top" />
                    </Grid>
                <StackPanel Visibility="Collapsed" Name="SecurityBossInfo" Height="35" Orientation="Horizontal" Margin="0,0,0,0">
                    <Label Content="Nombre:" Height="28" HorizontalAlignment="Left" Margin="30,5,0,0" Name="label14" VerticalAlignment="Top" />
                    <Label Content="" Height="28" HorizontalAlignment="Left" Margin="5,5,0,0" Name="lblSecBossName" VerticalAlignment="Top" FontWeight="Bold" />
                    <Label Content="Ci:" Height="28" HorizontalAlignment="Left" Margin="15,5,0,0" Name="label15" VerticalAlignment="Top" />
                    <Label Content="" Height="28" HorizontalAlignment="Left" Margin="5,5,0,0" Name="lblSecBossCi" VerticalAlignment="Top" FontWeight="Bold" />
                </StackPanel>
                </StackPanel>
                <Label Content="Debe seleccionar por lo menos a una funcionaria interviniente" Foreground="Red" Height="21" HorizontalAlignment="Left" Margin="30,8,0,0" Name="lblIntervinentsError" Visibility="Hidden" VerticalAlignment="Top" />
            </Grid>
        </GroupBox>
        <Button Height="40" HorizontalAlignment="Right" Margin="0,10,826,0" Name="Back" VerticalAlignment="Top" Width="64" Click="SaveAndContinue_Click">
            <StackPanel Orientation="Horizontal">
                <Image Height="16" Margin="0,2,0,0" Name="btnImg" Source="Images/Back.gif" VerticalAlignment="Center" />
                <TextBlock Text="ATRAS" VerticalAlignment="Center" />
            </StackPanel>
        </Button>
        <Label Content="Numero de Caso:" FontSize="20" FontWeight="Normal" Height="28" HorizontalAlignment="Left" Margin="90,14,0,0" Name="label28" VerticalAlignment="Top" />
        <Label Content="" FontSize="32" FontWeight="Light" Height="45" HorizontalAlignment="Left" Margin="248,5,0,0" Name="lblCaseNumber" VerticalAlignment="Top" />
        <Label Content="Fecha de Registro:" FontSize="20" FontWeight="Normal" Height="28" HorizontalAlignment="Left" Margin="414,15,0,0" Name="label39" VerticalAlignment="Top" />
        <Label Content="11/11/2011" FontSize="18" FontWeight="Normal" Height="28" HorizontalAlignment="Left" Margin="580,19,0,0" Name="lblRegistrationDate" VerticalAlignment="Top" />
        <Button Content="REGISTRAR" Height="41" Name="btnRegister" Width="136" Margin="642,1269,122,40" Click="btnRegister_Click" />
        <Label Content="*" FontSize="18" Foreground="Red" Height="16" HorizontalAlignment="Left" Margin="206,56,0,0" Name="label40" VerticalAlignment="Top" />
        <Label Content="Todos los campos marcados con" Foreground="Gray" Height="16" HorizontalAlignment="Left" Margin="30,56,0,0" Name="label41" VerticalAlignment="Top" />
        <Label Content="son obligatorios" Foreground="Gray" Height="20" HorizontalAlignment="Left" Margin="217,56,0,0" Name="label42" VerticalAlignment="Top" />
    </Grid>
</UserControl>
